# Copyright 2018-present RebirthDB
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
# This file incorporates work covered by the following copyright:
#
#     Copyright 2010-present, The Linux Foundation, portions copyright Google and
#     others and used with permission or subject to their respective license
#     agreements.
#
#     Licensed under the Apache License, Version 2.0 (the "License");
#     you may not use this file except in compliance with the License.
#     You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
#     Unless required by applicable law or agreed to in writing, software
#     distributed under the License is distributed on an "AS IS" BASIS,
#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#     See the License for the specific language governing permissions and
#     limitations under the License.

# This file contains the default values of all the variables that can affect the build that
# are not set by the configure script. All these variables should be listed and documented here.
# mk/check-env.mk generates warnings when a user sets a variable that is not defined in here.

# Place local and temporary changes to these variables in a file called custom.mk at the
# root of the source tree instead of modifying this file.

# Configuration file generated by ./configure
CONFIG ?= $(TOP)/config.mk

# Default goal
DEFAULT_GOAL ?= all

# If set to 1, make will not recompile when one of the makefiles changes
IGNORE_MAKEFILE_CHANGES ?= 0

# Show the number of targets left to build
SHOW_COUNTDOWN ?= 1

# If set to 1, make will show every command that it executes
VERBOSE ?= 0

# set to 1 to link all libraries statically
STATIC ?= 0

# Package name without modfiers
VANILLA_PACKAGE_NAME ?= rebirthdb

# Name of the rebirthdb executable
SERVER_EXEC_NAME ?= rebirthdb

# Set SYMBOLS to 1 to enable symbols, even in release mode
SYMBOLS ?= 1

# Put the symbols in a separate file
SPLIT_SYMBOLS ?= 0

# Set to 0 for release mode or 1 for debug mode
DEBUG ?= 0

# Build unit tests
UNIT_TESTS ?= $(DEBUG)

# Set to 1 to enable valgrind awareness
VALGRIND ?= 0

# Build directory (empty for default)
BUILD_DIR ?=

# Destination directory when installing. Defaults to /
DESTDIR ?=

# Check for unknown variables in custom.mk
MAKE_VARIABLE_CHECK ?= 1

# Enable code coverage
COVERAGE ?= 0

# Enable generation of the HTML report
GENHTML ?= 0

# Strip the executable when installing
STRIP_ON_INSTALL ?= 0

# If not empty, $(PVERSION) is used as the rebirthdb version number
# for example, PVERSION ?= 1.3.2
PVERSION ?=

# Include the rebirthdb version number in the executable name and package name
NAMEVERSIONED ?= 0

# When packaging, build a package for this ubuntu or debian release name
UBUNTU_RELEASE ?=
DEB_RELEASE ?=

# For each triggered rule, show one of the dependencies that caused it to be run
SHOW_BUILD_REASON ?= 0

# Enable backtraces for RQL errors
RQL_ERROR_BT ?= 0

# Always collect full perfmon stats. This makes RebirthDB slower
# but can be useful for analyzing performance issues.
FULL_PERFMON ?= 0

# Turn on the coroutine profiler
CORO_PROFILING ?= 0

# Sign the DSC file
SIGN_PACKAGE ?= 1

# When rebuilding the package for an already published version of RebirthDB, this
# variable should be incremented.
PACKAGE_BUILD_NUMBER ?= 0

# Implement coroutines on top of (POSIX) threads
THREADED_COROUTINES ?= 0

# Require MacOS package to be signed with a developer certificate
REQUIRE_SIGNED ?= 0
OSX_SIGNATURE_NAME ?= Hexagram 49, Inc. (99WDWQ7WDJ)

# Adds default configure flags to the package being built
DIST_CONFIGURE_DEFAULT ?=

# Minify the webui source code with "uglify".
UGLIFY ?= 1

# Check the hash of fetched archives
VERIFY_FETCH_HASH=1

# TODO: Document these variables
STATIC_LIBGCC ?= 0
BUILD_PORTABLE ?= 0
LEGACY_LINUX ?= 0
LEGACY_GCC ?= 0
NO_EVENTFD ?= 0
NO_EPOLL ?= 0
